import type { TrainType, TrainStatus, CarriageType, SeatType, OrderStatus, TicketStatus, UserRole } from '@/types/train'

// 车次类型选项
export const TRAIN_TYPES: { value: TrainType; label: string }[] = [
  { value: 'G', label: '高铁(G)' },
  { value: 'D', label: '动车(D)' },
  { value: 'C', label: '城际(C)' },
  { value: 'Z', label: '直达(Z)' },
  { value: 'T', label: '特快(T)' },
  { value: 'K', label: '快速(K)' }
]

// 车次状态
export const TRAIN_STATUS: Record<string, TrainStatus> = {
  ACTIVE: 'ACTIVE',
  CANCELLED: 'CANCELLED'
}

// 车次状态映射
export const TRAIN_STATUS_MAP: Record<TrainStatus, string> = {
  ACTIVE: '正常',
  CANCELLED: '取消'
}

// 车次状态标签类型
export const TRAIN_STATUS_TYPES: Record<TrainStatus, string> = {
  ACTIVE: 'success',
  CANCELLED: 'danger'
}

// 车厢类型选项
export const CARRIAGE_TYPES: { value: CarriageType; label: string }[] = [
  { value: 'FIRST_CLASS', label: '一等座' },
  { value: 'SECOND_CLASS', label: '二等座' },
  { value: 'SLEEPER', label: '卧铺' },
  { value: 'STANDING', label: '站票' }
]

// 车厢类型映射
export const CARRIAGE_TYPE_MAP: Record<CarriageType, string> = {
  FIRST_CLASS: '一等座',
  SECOND_CLASS: '二等座',
  SLEEPER: '卧铺',
  STANDING: '站票'
}

// 座位类型选项
export const SEAT_TYPES: { value: SeatType; label: string }[] = [
  { value: 'WINDOW', label: '靠窗' },
  { value: 'AISLE', label: '过道' },
  { value: 'MIDDLE', label: '中间' }
]

// 座位类型映射
export const SEAT_TYPE_MAP: Record<SeatType, string> = {
  WINDOW: '靠窗',
  AISLE: '过道',
  MIDDLE: '中间'
}

// 座位状态标签类型
export const SEAT_STATUS_TYPES = {
  true: 'success',  // 可用
  false: 'danger'   // 不可用
}

export const SEAT_STATUS_MAP = {
  true: '可用',
  false: '已售'
}

// 订单状态映射
export const ORDER_STATUS_MAP: Record<OrderStatus, string> = {
  PENDING: '待付款',
  PAID: '已付款',
  CANCELLED: '已取消',
  REFUNDED: '已退款'
}

// 订单状态标签类型
export const ORDER_STATUS_TYPES: Record<OrderStatus, string> = {
  PENDING: 'warning',
  PAID: 'success',
  CANCELLED: 'info',
  REFUNDED: 'danger'
}

// 票务状态映射
export const TICKET_STATUS_MAP: Record<TicketStatus, string> = {
  VALID: '有效',
  USED: '已使用',
  CANCELLED: '已取消',
  REFUNDED: '已退款'
}

// 票务状态标签类型
export const TICKET_STATUS_TYPES: Record<TicketStatus, string> = {
  VALID: 'success',
  USED: 'info',
  CANCELLED: 'warning',
  REFUNDED: 'danger'
}

// 用户角色映射
export const USER_ROLE_MAP: Record<UserRole, string> = {
  ADMIN: '管理员',
  USER: '普通用户'
}